/*
 * Copyright 2020 The Kubernetes Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../PatternFly/common';

/* breadcrumbs */
body[kui-theme-style] nav[aria-label='Breadcrumb'] {
  &,
  .pf-c-breadcrumb__list {
    /* see https://github.com/IBM/kui/issues/4431 */
    overflow-x: hidden;

    /* see https://github.com/IBM/kui/issues/6878 */
    overflow-y: hidden;
  }

  .pf-c-breadcrumb__list {
    /* see https://github.com/IBM/kui/issues/4431 */
    flex-wrap: initial;
  }

  &.pf-c-breadcrumb {
    padding: 0 1em;
    padding-left: 0;

    .pf-c-breadcrumb__item {
      font-size: unset;
      &.kui--version-breadcrumb .pf-c-breadcrumb__link {
        color: var(--color-base0F);
      }

      &.kui--secondary-breadcrumb {
        /* see https://github.com/IBM/kui/issues/4431 */
        overflow: hidden;
        font-weight: normal;
        color: var(--color-text-02);

        .pf-c-breadcrumb__link {
          /* see https://github.com/IBM/kui/issues/4431 */
          color: var(--color-text-02);
          overflow-x: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
        }
      }

      &:not(.kui--secondary-breadcrumb) {
        &.kui--current-page-breadcrumb {
          &.pf-c-breadcrumb__link,
          & .pf-c-breadcrumb__link {
            font-weight: 700;
            color: var(--color-text-01);
          }
        }

        .pf-c-breadcrumb__link {
          font-weight: 500;
        }
      }

      .pf-c-breadcrumb__link {
        text-decoration: unset;
        &.pf-m-current {
          &:hover {
            text-decoration: underline;
          }
        }
      }
    }
  }
}
